import Vue from 'vue'
import Router from 'vue-router'
import index from '../pages/index.vue'
import news from '../pages/news/news.vue'
import aboutUs from '../pages/footer/aboutUs'
import footer from '../pages/footer/footer'
// import login from '../pages/user/login.vue'
// import register from '../pages/user/register.vue'
import user from '../pages/user/user.vue'
import resetPassWord from '../pages/user/resetPassWord.vue'
import kuaiXun from '../pages/news/kuaixun.vue'
import hot from '../pages/news/hot.vue'
import subscribe from '../pages/news/mySubscribe.vue'
import custom from '../pages/news/custom.vue'
import customTopic from '../pages/custom/custom'
import addCustomTopic from '../pages/custom/add'
import myCustomTopic from '../pages/custom/my-coustom'
import search from '../pages/search/search'
import topic from '../pages/myTopic/topic'
import topicAll from '../pages/myTopic/all'
import topicSelect from '../pages/myTopic/selected'
import articlePage from '../pages/article/articlePage'
Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/footer',
      name: 'footer',
      component: footer,
      children: [
        {
          path: 'aboutUs',
          name: 'aboutUs',
          component: aboutUs,
          meta: {
            auth: false,
            title: '关于创投内参',
            footer: true
          }
        }
      ]
    },
    {
      path: '/custom-topic',
      name: 'customTopic',
      component: customTopic,
      children: [
        {
          path: 'add',
          name: 'addCustomTopic',
          component: addCustomTopic,
          meta: {
            auth: true,
            title: '话题定制',
            footer: true
          }
        },
        {
          path: 'my',
          name: 'myCustomTopic',
          component: myCustomTopic,
          meta: {
            auth: true,
            title: '话题定制',
            footer: true
          }
        }
      ]
    },
    {
      path: '/search',
      name: 'search',
      component: search,
      meta: {
        auth: false,
        title: '搜索',
        footer: true
      }
    },
    {
      path: '/',
      name: 'index',
      component: index,
      redirect: '/news1/alerts',
      meta: {
        auth: false,
        title: '首页'
      }
    },
    {
      path: '/news:id',
      name: 'news',
      component: news,
      redirect: '/news1/alerts',
      children: [
        {
          path: 'alerts',
          name: 'alerts',
          component: kuaiXun
        },
        {
          path: 'hot',
          name: 'hot',
          component: hot
        },
        {
          path: 'subscribe',
          name: 'subscribe',
          component: subscribe
        },
        {
          path: 'custom',
          name: 'custom',
          component: custom
        }
      ],
      meta: {
        auth: false,
        title: '创投内参',
        footer: true
      }
    },
    {
      path: '/user',
      name: 'user',
      redirect: '/login',
      component: user,
      children: [
        // {
        //   path: 'login',
        //   name: 'login',
        //   component: login,
        //   meta: {
        //     auth: false,
        //     title: '登录',
        //     footer: false
        //   }
        // },
        // {
        //   path: 'register',
        //   name: 'register',
        //   component: register,
        //   meta: {
        //     auth: false,
        //     title: '注册',
        //     footer: false
        //   }
        // },
        {
          path: 'resetPassWord',
          name: 'resetPassWord',
          component: resetPassWord,
          meta: {
            auto: true,
            title: '重置密码',
            footer: false
          }
        }
      ]
    },
    {
      path: '/topic',
      name: 'topic',
      component: topic,
      children: [
        {
          path: 'all',
          name: 'topicAll',
          component: topicAll
        },
        {
          path: 'select',
          name: 'topicSelect',
          component: topicSelect
        }
      ],
      meta: {
        auth: true,
        title: '话题定制',
        footer: true
      }
    },
    {
      path: '/articlePage:id',
      name: 'articlePage',
      component: articlePage,
      meta: {
        auth: false,
        title: '创投内参',
        footer: false
      }
    },
    {
      path: '*',
      redirect: '/news1/alerts'
    }
  ]
})
